﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using AspNetInfo.Diagnostics;
using System.Web.UI;

namespace AspNetInfo.Helpers
{
    public static class TestStatusImgBinder
    {
        public static string Eval(TestStatus status)
        {
            var img = string.Empty;
            var page = HttpContext.Current.Handler as Page;
            

            switch (status)
            {
                case TestStatus.New:
                    img = page.ClientScript.GetWebResourceUrl(typeof(AspNetInfo), "AspNetInfo.Resources.control_play_blue.png");
                    break;
                case TestStatus.Passed:
                    img = page.ClientScript.GetWebResourceUrl(typeof(AspNetInfo), "AspNetInfo.Resources.accept.png");
                    break;
                case TestStatus.Warning:
                    img = page.ClientScript.GetWebResourceUrl(typeof(AspNetInfo), "AspNetInfo.Resources.error.png");
                    break;
                case TestStatus.Failed:
                    img = page.ClientScript.GetWebResourceUrl(typeof(AspNetInfo), "AspNetInfo.Resources.cancel.png");
                    break;
                default:
                    img = page.ClientScript.GetWebResourceUrl(typeof(AspNetInfo), "AspNetInfo.Resources.ajax-loader.gif");
                    break;
            }
            return img;
        }
    }
}